/**
 * 通用 API 响应类型
 */
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
  success: boolean;
}

/**
 * 分页参数类型
 */
export interface PaginationParams {
  page: number;
  pageSize: number;
  total?: number;
}

/**
 * 分页响应类型
 */
export interface PaginatedResponse<T> {
  list: T[];
  pagination: PaginationParams;
}

/**
 * 用户信息类型
 */
export interface User {
  id: string;
  username: string;
  email: string;
  avatar?: string;
  role: 'admin' | 'user';
  createdAt: string;
  updatedAt: string;
}

/**
 * 菜单项类型
 */
export interface MenuItem {
  key: string;
  label: string;
  icon?: React.ReactNode;
  children?: MenuItem[];
  path?: string;
  permission?: string;
}

/**
 * 表格列配置类型
 */
export interface TableColumn {
  key: string;
  title: string;
  dataIndex: string;
  width?: number;
  fixed?: 'left' | 'right';
  sortable?: boolean;
  filterable?: boolean;
}

/**
 * 表单字段类型
 */
export interface FormField {
  name: string;
  label: string;
  type: 'input' | 'textarea' | 'select' | 'date' | 'number' | 'switch';
  required?: boolean;
  placeholder?: string;
  options?: Array<{ label: string; value: any }>;
  rules?: any[];
}

/**
 * 主题配置类型
 */
export interface ThemeConfig {
  primaryColor: string;
  mode: 'light' | 'dark';
  borderRadius: number;
  fontSize: {
    small: number;
    normal: number;
    large: number;
  };
}
